Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
[Vue warn]: Invalid prop: type check failed for prop "disabled". Expected Boolean, got Function

I am using this code

<v-list-item>
            <v-btn
              @click="onDownloadFile(document)"
              :disabled=getFileExtention
              >Download as pdf</v-btn
            >
</v-list-item>

where getFileExtention returns boolean

getFileExtention() {
     //console.log(this.document.extension==="pdf");
     return this.document.extension === "pdf";
   }

but its not working , still saying [Vue warn]: Invalid prop: type check failed for prop "disabled". Expected Boolean, got Function . Kindly help

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

define getFileExtension as computed property :

computed:{
getFileExtention() {
     //console.log(this.document.extension==="pdf");
     return this.document.extension === "pdf";
   }
}

then use it like :disabled="getFileExtention"

about 4 years ago · Juan Pablo Isaza Report

0

You need to define getFileExtention as methods for this.

methods:{
getFileExtention() {
     return this.document.extension === "pdf";
   }
}

But if you want the caching ability based on reactive dependencies, you can also use computed property

computed:{
    getFileExtention() {
         return this.document.extension === "pdf";
       }
    }
about 4 years ago · Juan Pablo Isaza Report

0

Add Boolean(getFileExtension) in your :disabled, this way you are saying that your variable is a boolean, and the warning will disappear.

<v-list-item>
        <v-btn
          @click="onDownloadFile(document)"
          :disabled="Boolean(getFileExtention)"
          >Download as pdf
        </v-btn>
</v-list-item>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!